VT-d: various initialization fixes
Detect invalid/unsupported configurations in iommu_alloc() - offsets
read from hardware must not lead to exceeding a single page (since
only that much gets mapped). This covers the apparently not uncommon
case of the address pointed to by a DMAR reading as all ones (Linux
for example also checks for this).
Further correct error handling of that function: Without storing the
allocated "struct iommu" instance in the drhd, iommu_free() won't do
anything, and hence all successfully set up pieces would be leaked.
Also keep iommu_free() from calling destroy_irq() when no irq was
ever set up.
Additionally, clear_fault_bits() has no need to read the capabilities
field from I/O memory - it's already cached in "struct iommu".
Finally, simplify print_iommu_regs() and its output, and actually use
this function.
Signed-off-by: Jan Beulich <jbeulich@novell.com>